package cn.dengta.webapp.user.dto;

import cn.dengta.webapp.user.entity.PrizeLog;
import cn.dengta.webapp.user.entity.User;
import cn.dengta.webapp.user.model.Gender;
import lombok.*;
import me.codeplayer.util.X;

/**
 * 动态打卡
 */
@Getter
@Setter
public class PrizeLogDTO extends PrizeLog {

	/** 奖品名称 */
	private String prizeName;
	/** 奖品等级 */
	private Integer prizeLevel;
	/** 活动名称 */
	private String activityName;
	/** 用户 */
	@Setter(AccessLevel.NONE)
	private User user;

	public PrizeLog setUId(Long userId) {
		user().setId(userId);
		this.setUserId(userId);
		return this;
	}

	public void setUserNickname(String nickname) {
		user().setNickname(nickname);
	}

	public void setUserGender(Gender gender) {
		user().setGender(gender);
	}

	public void setUserAvatar(String avatar) {
		user().setAvatar(avatar);
	}

	private User user() {
		return user = X.getElse(user, User::new);
	}

}
